package com.ming.tank;

import java.io.IOException;
import java.util.Properties;

/**
 * @ClassName ProperMgr
 * @Description 配置类
 * @Author H.M
 * @Date 2021/6/27
 * @Version 1.0
 **/
public class ProperMgr {

    private static volatile ProperMgr  properMgr  = null ;

    private  static  Properties  props = new Properties();

    private  ProperMgr() {
    }

    public  static ProperMgr getInstance() {
        if ( null  ==  properMgr) {
            synchronized (ProperMgr.class) {
                properMgr = new ProperMgr();
            }
        }
        return  properMgr;
    }

    static {
        try {
            props.load(ProperMgr.class.getClassLoader().getResourceAsStream("config"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public  Object get (String key) {
        return props.get(key);
    }

}
